package com.xuecheng.learning.agent;

import com.xuecheng.api.media.model.ResourceUrlModel;
import com.xuecheng.common.constant.XcFeignServiceNameList;
import com.xuecheng.common.domain.response.RestResponse;
import com.xuecheng.learning.agent.hystrix.MediaApiAgentFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Created on 2021/04/05/19:43 周一
 *
 * @author Lantin
 */

@FeignClient(value = XcFeignServiceNameList.XC_MEDIA_SERVICE, fallbackFactory = MediaApiAgentFallbackFactory.class)
public interface MediaApiAgent {


    @GetMapping("media/l/media-url/{mediaId}")
    RestResponse<ResourceUrlModel> getMediaUrl(@PathVariable Long mediaId);

    @GetMapping("/media/l/live/play-url")
    ResourceUrlModel getLivePlayUrl(@RequestParam("coursePubId") Long coursePubId,
                                    @RequestParam("teachplanId") Long teachplanId);

}
